<template>
    <div class="gold-shop-wrap">
        <van-nav-bar title="订单详情" left-arrow fixed @click-left="onClickLeft" />
        <div class="obligation_top">
            <div class="obligation_top_time">
                <div v-if="orderInfo.top_title == '已退款'" style="color: #2CC365;">
                    {{ orderInfo.top_title }}
                </div>
                <div v-if="orderInfo.top_title == '已拒绝'" style="color: #F32A23;">
                    {{ orderInfo.top_title }}
                </div>
                <div v-if="orderInfo.top_title == '审核中'" style="color:#FEB900;">
                    {{ orderInfo.top_title }}
                </div>
                <div>
                    {{ orderInfo.top_desc }}
                </div>
            </div>
        </div>
        <div class="refund_amt" v-if="orderInfo.top_title == '已退款'">
            <div><img src="../../../../images/mine/tuikuan.png" alt=""><span>退款金额</span></div>
            <div>{{ orderInfo.middle_desc }}</div>
        </div>
        <div class="refund_info">退款信息</div>
        <div class="order_name">
            <div class="order_name_left"> <img src="../../../../images/mine/shop.png" alt="">{{ orderInfo.shop_name }}
            </div>
        </div>
        <div v-for="item, index in orderInfo.items" :key="index">
            <div class="order_list">
                <img :src="item.left_icon" alt="">
                <div class="order_goods">
                    <div class="order_goods_name">{{ item.title }}</div>
                    <div class="order_goods_sku">{{ item.sku_text }}</div>
                    <div class="order_goods_price" v-html="item.price_text"></div>
                </div>
            </div>
        </div>
        <!--  -->
        <div class="obligation_item">
            <div class="obligation_item_con" v-for="item, index in orderInfo.expense_items" :key="index">
                <div>{{ item.left_text }}</div>
                <div>{{ item.right_text }}</div>
            </div>
        </div>
        <!-- <div class="obligation_bom">
            <div class="obligation_btn">
                <div class="obligation_btn_price"></div>
                <div>
                    <van-button class="order_pay_btn" size="small" round>删除订单</van-button>
                    <van-button class="order_pay_btn" size="small" round @click="getAfterSales">申请售后</van-button>
                    <van-button class="order_pay_btn" color="linear-gradient(to right, #FF5851, #E9011B)" size="small"
                        round>再次购买</van-button>
                </div>
            </div>
        </div> -->
    </div>
</template>
<script>
import { AFTER_SALES_INFO } from '@/api/mine'
export default {
    // props:['orderInfo'],
    data() {
        return {
            orderInfo: {}
        }
    },
    mounted() {
        window.scrollTo(0, 0)

        this.$http.get(AFTER_SALES_INFO + this.$route.query.id).then(res => {
            this.orderInfo = res.data
        })
    },
    methods: {
        onClickLeft() {
            this.$router.back()
        },
        getAfterSales() {
            // this.$router.push({path: '/afterSales'})
        }
    },
}
</script>
<style lang="scss" scoped>
.gold-shop-wrap {
    min-height: calc(100vh - 46px);
    padding-top: 46px;
    background: #F4F4F4;;

    ::v-deep .van-nav-bar .van-icon {
        color: #333;
    }

    ::v-deep .van-nav-bar__title {
        color: #333;
    }

    ::v-deep .van-nav-bar__arrow {
        font-size: 20px;
        color: #fff;
    }
}

::v-deep .van-nav-bar,
::v-deep .van-nav-bar__content {
    background: #fff;
    position: fixed; // 改为固定定位
    top: 0; // 添加这行
    left: 0; // 添加这行
    right: 0; // 添加这行
    z-index: 1000; // 添加这行，确保它在其他元素之上
}

.obligation_top {
    background: #fff;
    padding: 0.3rem;
    margin: 0 auto;
    // background: url('../../../../images/mine/bg.png') no-repeat center;
    background-size: cover;
    // margin-top: -1rem;
    // height: 2.4rem;
    // padding-top: 1.2rem;
    box-sizing: border-box;

    .obligation_top_time {
        display: flex;
        justify-content: space-between;
        font-weight: bold;
        font-family: PingFangSC, PingFang SC;
        font-size: 0.4rem;
        color: #FEB900;
        line-height: .56rem;
        text-align: left;
        font-style: normal;

        // margin-bottom: 0.3rem;
        div:last-child {
            font-family: PingFangSC, PingFang SC;
            font-weight: 400;
            font-size: .28rem;
            color: #fff;
            line-height: .4rem;
            text-align: center;
            margin-top: 0.15rem;
            font-style: normal;
        }
    }
}

.refund_amt {
    background-color: #fff;
    font-family: PingFangSC, PingFang SC;
    font-weight: bold;
    font-size: .28rem;
    color: #333333;
    line-height: .4rem;
    text-align: left;
    font-style: normal;
    display: flex;
    justify-content: space-between;
    padding: 0 .32rem 0.2rem .32rem;
    margin-bottom: 0.16rem;
    padding-top: .2rem;

    div {
        img {
            width: .32rem;
            height: .32rem;
            vertical-align: middle;
            margin-right: .16rem
        }
    }

    div:last-child {
        font-family: PingFangSC, PingFang SC;
        font-weight: 500;
        font-size: .32rem;
        color: #F9301B;
        line-height: .44rem;
        text-align: center;
        font-style: normal;
    }
}

.refund_info {
    background: #fff;
    padding-left: 0.32rem;
    padding-top: 0.2rem;
    font-family: PingFangSC, PingFang SC;
    font-weight: 400;
    font-size: 0.28rem;
    color: #666666;
    line-height: .4rem;
    text-align: left;
    font-style: normal;
}

.order_name {
    background: #fff;
    display: flex;
    justify-content: space-between;
    font-size: 0.28rem;
    padding: 0.32rem;
    // margin-top: 0.16rem;
    // border-bottom: 0.01rem solid #999;
    box-sizing: border-box;

    img {
        width: 0.4rem;
        height: .4rem;
        vertical-align: middle;
        margin-right: .16rem;
        margin-bottom: 0.06rem;
    }

    &_left {
        font-weight: bold;
    }

    &_right {
        font-size: 0.25rem;
    }
}

.order_list {
    background: #fff;
    padding: 0 0.32rem 0.2rem 0.32rem;
    display: flex;
    justify-content: space-between;
    // border-bottom: 0.01rem solid #999;

    img {
        width: 1.8rem;
    }

    .order_goods {
        width: 70%;
        font-size: 0.3rem;
        line-height: 0.6rem;

        &_name {
            // font-size: 0.3rem;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            /* 控制显示的行数 */
            -webkit-box-orient: vertical;
            overflow: hidden;
            text-overflow: ellipsis;
            line-height: 0.35rem;
            font-size: 0.3rem;
            // font-weight: bold;
        }

        &_sku {
            font-size: 0.28rem;
            color: #999;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        &_price {
            font-size: 0.24rem;
            // font-weight: bold;
            display: flex;
            justify-content: space-between;
            color: #F32A23;
            margin-top: 0.2rem;

            span:last-child {
                font-weight: 500;
                font-size: 0.25rem;
                color: #999;
            }
        }
    }
}

.obligation_item {
    padding: 0.2rem;
    margin-top: 0.2rem;
    background: #fff;

    .obligation_item_con {
        display: flex;
        justify-content: space-between;
        font-size: 0.28rem;
        line-height: 0.6rem;

        div:last-child {
            color: #999999;
        }
    }
}

.obligation_bom {
    width: 100%;
    position: fixed;
    bottom: 0;
    // border-top: 0.01rem solid #999;
    background: #fff;

    .obligation_btn {
        padding: 0.2rem;
        display: flex;
        justify-content: space-between;
        font-size: 0.3rem;

        .obligation_btn_price {
            margin-top: 0.1rem;
        }

        // position: absolute;
        // bottom: 0;
        div {

            .order_pay_btn {
                margin-left: 0.2rem;
            }
        }
    }
}
</style>
